package ast;

import java.util.ArrayList;

public class CompositeBinder extends Binder {

	private QualityPredicate q;
	private ArrayList<Binder> componentBinders;
	
	public CompositeBinder(QualityPredicate pred, ArrayList<Binder> bdList)
	{
		q = pred;
		componentBinders = bdList;
	}
	
	public QualityPredicate getQ() {
		return q;
	}

	public void setQ(QualityPredicate q) {
		this.q = q;
	}

	public ArrayList<Binder> getComponentBinders() {
		return componentBinders;
	}

	public void setComponentBinders(ArrayList<Binder> componentBinders) {
		this.componentBinders = componentBinders;
	}

	public String toString()
	{
		String res = "";
		res += "&_" + q + "(";
		for (int i = 0; i < componentBinders.size(); i++) {
			res += componentBinders.get(i);
			if (i != componentBinders.size() - 1)
				res += ", ";
		}
		res += ")";
		
		return res;
	}
}
